<template>
    <div class="warning-detail">
        <h2 class="title">预警详情&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp


          <spen @click="back">&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
            返回上一页</spen></h2>
        <div class="card content">
            <div class="item" v-for="item in dataInfo" :key="item.label" >
                <div class="label">{{ item.label }}</div>
                <div class="value" style="width: 40%;">{{ item.value }}</div>
            </div>
        </div>
    </div>
</template>
<script>
import DetailInfo from '@/components/detail-info/index.vue'
import DetailTable from '@/components/detail-table/index.vue'

export default {
    name: 'WarningDetail',
    components: {
        DetailInfo,
        DetailTable
    },
    data() {
        return {
            dataInfo: [
                {
                    label: '规则编号',
                    value: '米卡分静'

                },
                {
                    label: '预警名称',
                    value: '计划生育预警'

                },
                {
                    label: '预警数据源',
                    value: '处方数据'

                },
                {
                    label: '规则描述',
                    value: '计划生育预警'

                },
            ]
        }
    },
  created() {
    console.log(this.$route.params.number)
    let ruleNumber=this.$route.params.number.ruleNumber
    let name=this.$route.params.number.name
    let sourceDataType= ''
    if(this.$route.params.number.sourceDataType ==1){
      sourceDataType= '就诊数据预警'
    } else {
      sourceDataType= '医疗机构数据预警'
    }

    let cautionContent=this.$route.params.number.cautionContent
    this.getList(ruleNumber,name,sourceDataType,cautionContent);
  },
  methods: {
    back() {
      this.$router.go(-1); // 返回上一页
    },
    getList(ruleNumber, name, sourceDataType,cautionContent) {
       this.dataInfo = [
         {
           label: '规则编号',
           value: ruleNumber

         },
         {
           label: '预警名称',
           value: name

         },
         {
           label: '预警数据源',
           value: sourceDataType

         },
         {
           label: '规则描述',
           value: cautionContent

         },
       ]
    }
  }
}
</script>
<style scoped lang="scss">
.warning-detail {
    height: 100%;
    display: flex;
    flex-direction: column;

}
.card {
    background-color: #fff;
    padding: 5px 13px 19px;
    margin-top: 14px;
}
.content {
    padding-top: 31px;
    display: flex;
    flex-direction: column;
    height: 100%;
    .item {
        display: flex;
        line-height: 40px;
        .label {
            width: 100px;
            font-weight: 500;
            font-size: 16px;
            color: #8B8B8B;
        }
        .value {
            font-weight: 500;
            font-size: 16px;
            color: #4B4B4B;
        }
    }
}

</style>
